package com.online.jta.biz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.online.jta.dao.JtaDao;
import com.online.jta.dao.UserDao;
import com.online.jta.dao.UsersDao;

@Service
@Transactional
public class UserBiz {

    @Autowired
    private UserDao  userDao;
    @Autowired
    private UsersDao usersDao;
    @Autowired
    private JtaDao jtaDao;

    public void save() {
        userDao.save();
    }

    public void update() {
        usersDao.updateLoginCount(10);
        jtaDao.update();
        usersDao.updateLoginCount(10);
        //System.out.println(1 / 0);
    }
}
